package com.tiancheng.trade.merchant.controller.api;

import com.tiancheng.trade.commom.core.data.Result;
import com.tiancheng.trade.merchant.exception.BusinessException;
import com.tiancheng.trade.merchant.model.Organization;
import com.tiancheng.trade.merchant.service.IOrganizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/organization")
public class OrganizationController {
    @Autowired
    IOrganizationService organizationService;

    /**
     * 查询所有组织
     *
     * @param organizationVO {@link Organization}
     * @return {@link Result}<{@link List}<{@link Organization}>>
     */
    @GetMapping("/findList")
    public Result<List<Organization>> findList(Organization organizationVO) throws BusinessException {
        return Result.success(organizationService.findList(organizationVO));
    }

}
